﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using Utility1;

namespace Thv
{
    public class Global : System.Web.HttpApplication
    {
        public static string SESS_SECURITY_CODE = "SESS_SECURITY_CODE";
        public static string SESS_USER = "SESS_USER";
        protected void Application_Start(object sender, EventArgs e)
        {

        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
        /// <summary>
        /// Encode a ecoded string value
        /// </summary>
        /// <param name="encodedvalue"></param>
        /// <returns></returns>
        public static string ToEncoding(string value)
        {
            return Encryption64.Encrypt(value, "1A2B3C4D").ToLower();
        }
        /// <summary>
        /// Decode a ecoded string value
        /// </summary>
        /// <param name="encodedvalue"></param>
        /// <returns></returns>
        public static string ToDecoding(string encodedvalue)
        {
            return Encryption64.Decrypt(encodedvalue, "1A2B3C4D");
        }
    }
}